import request from "@/utils/service.js"

//账号登录接口
export let denglu = (adminUsername, adminPass) => {
    return request({
        url: "/admin/adminLongin",
        method: "POST",
        data: {
            // "adminDate": "2023-05-16T12:25:49.571Z",
            // "adminId": 0,
            // "adminMail": "string",
            // "adminName": "string",
            // "adminPic": "string",
            // "adminSex": "string",
            // "adminTel": "string",
            adminUsername,
            adminPass
        }
    })
}

//邮箱登录发送验证码
export let sendemail = (mail) => {
    return request({
        url: "/admin/sendMail",
        method: "GET",
        params: {
            mail
        }
    })
}
//邮箱登录接口
export let emaillogin = (mail, code) => {
    return request({
        url: "/admin/loginbyMail",
        method: "GET",
        params: {
            mail,
            code
        }
    })
}

//退出登录
export let exitdenglu = () => {
    return request({
        url: "/admin/logout",
        method: "GET",
    })
}



//订单页面
//今日订单
export let Era = () => {
    return request({
        url: "/order/findbyday",
        method: "GET",
        params: {
            "code": 0,
            "data": {},
            "msg": "string",
            "token": "string"
        }
    })
}
//历史订单
export let Erb = () => {
    return request({
        url: "/order/findbytime",
        method: "GET",

    })
}
//根据订单ID查询订单
export let findid = (orderId) => {
    return request({
        url: "/order/findByOrderId",
        method: "GET",
        params: {
            orderId
        }
    })
}




//查询所有桌位
export let cxzhuowei = () => {
    return request({
        url: "/dining/findAlldining",
        method: "GET",
    })
}



//设置页面，修改页面信息
export let xiugai = () => {
    return request({
        url: "/admin/updatebyid",
        method: "POST",
        data: {
            "code": 0,
            "data": {},
            "msg": "string",
            "token": "string"
        }
    })
}



//销售额
export let xiaoshou = () => {
    return request({
        url: "/order/findAllmoney",
        method: "GET",

    })
}


//查询所有库存
export let chaxunkucun = () => {
    return request({
        url: "/inventory/selectAll",
        method: "GET",

    })
}


//根据菜品id查询菜品
// export let caipinID=()=>{
//     return request ({
//         url:"/food/findOnebyId",
//         method:"GET",
//         params:{
//             foodId:""
//         }
//     })
// }